import router from './router'

router.beforeEach((to, from, next) => {
    const token = localStorage.getItem('etoak_cms_key')

    if (!token) {
   
        if (to.path !== '/login') {
            next({ path: '/login' })
        } else {
            next()
        }

    } else {

        next()
    }
})